#ifndef SETTINGCURVEDIALOG_H
#define SETTINGCURVEDIALOG_H

#include <QDialog>
#include <QVector>
#include <QModelIndex>

class LegendModel;
class AbstractPlot2D;
class ColorButton;

class CurveSettings {
public:
    QColor color;
    qreal penWidth;
    Qt::PenStyle penStyle;
    int symbol;
    int symbolSize;
    bool showCurve;
};

namespace Ui {
    class SettingCurveDialog;
}

class SettingCurveDialog : public QDialog {
    Q_OBJECT
public:
    SettingCurveDialog(AbstractPlot2D *plotter, QWidget *parent = 0);
    ~SettingCurveDialog();

private slots:
    void apply();
    bool removeCurve();
    void changeCurve(const QModelIndex &index);
    void initCurve();
    void changeLineStyle(int index);
    void changeLineWidth(double width);
    void changeSymbol(int symbol);
    void changeSymbolSize(int size);
    void changeColor(const QColor &color);
    void changeShowCurve(bool show);

protected:
    void changeEvent(QEvent *e);

private:
    Ui::SettingCurveDialog *ui;
    LegendModel *model;
    AbstractPlot2D *_plotter;
    ColorButton *_clrBtn;
    QVector<CurveSettings> _curveSettingsList;
};

#endif // SETTINGCURVEDIALOG_H
